public class EventLogManagerController extends Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
EventLogManagerController.DefaultInternalFrameListener
This inner class extends
InternalFrameAdapter for creating a
specific listener for the JInternalFrame frames. |
(package private) class |
EventLogManagerController.EventLogEditorDocumentListener
This inner class implements
DocumentListener for creating a specific
listener to use on the EventLogEditor
(textArea ). |
(package private) class |
EventLogManagerController.FilterPanelActionListener
This inner class implements
ActionListener for defining the
actionPerformed(ActionEvent)
method and creating a specific listener to use on the JButton
buttons of the FilterPanel panel. |
(package private) class |
EventLogManagerController.FooterAreaButtonActionListener
This inner class implements
ActionListener for defining the
actionPerformed(ActionEvent)
method and creating a specific listener to use on the
FooterAreaButton buttons. |
(package private) class |
EventLogManagerController.GenerateEventLogActionListener
This inner class implements
ActionListener for defining the
actionPerformed(ActionEvent)
method and creating a specific listener to use on the JButton
of all the dialogs that are created to manage the generation of event log from expressions. |
(package private) class |
EventLogManagerController.MainFrameKeyEventDispatcher
This inner class implements
KeyEventDispatcher to realise
a specific key event dispatcher to give to the KeyboardFocusManager
of the main JFrame . |
(package private) class |
EventLogManagerController.MainFrameWindowListener
This inner class extends
WindowAdapter for creating
a specific listener for the main JFrame . |
(package private) class |
EventLogManagerController.MenuAreaButtonActionListener
This inner class implements
ActionListener for defining the
actionPerformed(ActionEvent)
method and creating a specific listener to use on the JButton buttons of the
menuArea . |
(package private) class |
EventLogManagerController.PopupMenuItemActionListener
This inner class implements
ActionListener for defining the
actionPerformed(ActionEvent)
method and creating a specific listener to use on the JMenuItem
items of the JPopupMenu pop-up added to an
FooterAreaButton button. |
(package private) class |
EventLogManagerController.RecentButtonItemActionListener
This inner class implements
ActionListener for defining the
actionPerformed(ActionEvent)
method and creating a specific listener to use on the JMenuItem
items of the JPopupMenu pop-up added to an
MenuAreaButton button by the
EventLogManagerController.RecentButtonMouseListener listener. |
(package private) class |
EventLogManagerController.RecentButtonMouseListener
This inner class extends
MouseAdapter for creating a
specific listener for the MenuAreaButton "Recent" button. |
(package private) class |
EventLogManagerController.SettingsActionListener
This inner class implements
ActionListener for defining the
actionPerformed(ActionEvent)
method and creating a specific listener to use on the JButton
of the settings panel. |
Modifier and Type | Field and Description |
---|---|
private AnalysisManager |
analysisManager
The
AnalysisManager used by the Controller to manage all the operations
associated with the MenuAreaButton buttons in the application tab menu
that are connected to analysis procedures and management. |
private EventLogManagerController.DefaultInternalFrameListener |
defaultInternalFrameListener
This object, instance of the inner class
DefaultInternalFrameListener ,
will be the JInternalFrameListener for all the JInternalFrame
frames created. |
private EditorManager |
editorManager
The
EditorManager used by the Controller to manage all the operations
associated with the MenuAreaButton buttons in the application tab menu
that are connected to the management of logs, files and editors. |
private EventLogManagerModel |
elmModel
The
EventLogManagerModel element
that represents the Model of the application. |
private EventLogManagerView |
elmView
The
EventLogManagerView element
that represents the View of the application. |
private EventLogManagerController.EventLogEditorDocumentListener |
eventLogEditorDocumentListener
This object, instance of the inner class
EventLogEditorDocumentListener ,
will be the DocumentListener for all the
EventLogEditor text areas. |
private EventLogManagerController.FilterPanelActionListener |
filterPanelActionListener
This object, instance of the inner class
FilterPanelActionListener ,
will be the ActionListener for all the opened
FilterPanel . |
private EventLogManagerController.FooterAreaButtonActionListener |
footerAreaButtonActionListener
This object, instance of the inner class
FooterAreaButtonActionListener ,
will be the ActionListener for all the
FooterAreaButton buttons. |
private EventLogManagerController.GenerateEventLogActionListener |
generateEventLogActionListener
This object, instance of the inner class
GenerateEventLogActionListener ,
will be the ActionListener for all the dialogs that are created to
manage the generation of event log from expressions. |
private InfoManager |
infoManager
The
InfoManager used by the Controller to manage all the operations
associated with the MenuAreaButton buttons in the application tab menu
that are connected to the application in general (information about the system and
global settings). |
private EventLogManagerController.PopupMenuItemActionListener |
popupMenuItemActionListener
This object, instance of the inner class
PopupMenuItemActionListener ,
will be the ActionListener for all the JMenuItem items that are
inside the JPopupMenu pop-up menus associated to the
FooterAreaButton buttons. |
private EventLogManagerController.SettingsActionListener |
settingsActionListener
This object, instance of the inner class
SettingsActionListener ,
will be the ActionListener for all the dialogs that are created to
show and manage the application settings. |
Constructor and Description |
---|
EventLogManagerController(EventLogManagerView elmView,
EventLogManagerModel elmModel)
Constructs a new
EventLogMangerController , with the View and
the Model to manage. |
Modifier and Type | Method and Description |
---|---|
boolean |
checkInternetConnection(String url,
int timeout)
Checks if the given URL is reachable online in the given timeout,using an
HTTP connection, and if an HEAD request returns a success/redirect response
code or not.
|
private boolean |
closeInternalFrame(JInternalFrame internalFrame)
Closes the
JInternalFrame passed as parameter, if one is passed,
or the selected one inside the
contentArea ,
if a frame is set as selected. |
private void |
copyEventLog()
Copies the selected text in the text area of the
EventLogEditor editor
(the one selected inside the
contentArea )
into the system clipboard. |
private void |
cutEventLog()
Cuts the selected text in the text area of the
EventLogEditor editor
(the one selected inside the
contentArea )
into the system clipboard. |
private boolean |
exportDocument(String selectedFileName)
Opens an "Export" dialog to ask the user to decide where to export (and in which format)
the content either of the selected
EventLogEditor editor or of the selected
FootPrintMatrixInfo document (that are both inside the
contentArea ). |
FooterAreaButton |
findFooterAreaButton(JInternalFrame target)
Searches for the associated
FooterAreaButton button of the target
JInternalFrame , returning it or null otherwise. |
JInternalFrame |
findJInternalFrame(String targetID)
Searches for the target
JInternalFrame inside the
contentArea
using its title, returning it or null otherwise. |
private void |
generateEventLog(String exp)
Generates a XES log from the passed expression that defines the possible event traces.
|
private void |
generateEventLogFootprint(boolean showMatrix,
EventLogEditor editor,
FootprintFilter... filter)
This method analyses the XES log contained inside the selected
EventLogEditor (or the passed one as parameter),
using the EventLogEditor filter (or the one passed as parameter), creating at the end of the process a HTML report
with a footprint matrix in it representing the casual dependencies between event traces. |
private void |
generateXesFromCsv()
Generates a XES log from the content (in a CSV-format) of the selected
EventLogEditor
(the one inside the contentArea ). |
AnalysisManager |
getAnalysisManager()
This method returns the
AnalysisManager analysisManager element. |
EditorManager |
getEditorManager()
This method returns the
EditorManager editorManager element. |
InfoManager |
getInfoManager()
This method returns the
InfoManager infoManager element. |
EventLogManagerModel |
getModel()
This method returns the
EventLogManagerModel elmModel element. |
EventLogManagerView |
getView()
This method returns the
EventLogManagerView elmView element. |
private boolean |
importDocument(String selectedFileName)
Opens an "Import" dialog to ask the user to select which file to import, then the method tries
to import it (.CSV and .HTML extensions available).
|
void |
modifyJInternalFrameTitles(JInternalFrame targetInternalFrame,
String newTitle)
Sets the title of the target internal frame as the
newTitle passed as parameter
and then updates all its references in the associated FooterAreaButton to keep
the integrity and the association between them. |
private void |
newEventLog()
Asks the View to open a dialog to make the user decide
between an empty Event Log or a generation of an Event Log starting
from an expression that defines the possible event traces.
|
void |
newEventLogEditor(String editorTitle,
Reader editorContent,
String associatedFilePath,
boolean isContentModified)
Asks the View to add a new
EventLogEditor internal frame inside the
contentArea ,
then adds a new FooterAreaButton button inside the
footerArea ,
both with the same title. |
void |
newFootprintMatrixInfo(String documentTitle,
String documentContent,
String associatedFilePath,
boolean isContentExported)
Asks the View to add a new
FootprintMatrixInfo internal frame inside the
contentArea ,
then adds a new FooterAreaButton button inside the
footerArea ,
both with the same title. |
void |
newInternalFrame(String frameTitle,
Component frameContent)
Asks the View to add a new
JInternalFrame object inside the
contentArea ,
then adds a new FooterAreaButton button inside the
footerArea ,
both with the same title. |
private void |
openEventLog(String selectedFileName)
Opens an "Open" dialog to ask the user to select which file to open, then the method tries
to open it (.XES and .TXT extensions available).
|
private void |
pasteEventLog()
Pastes the content of the system clipboard in the text area of the
EventLogEditor
editor (the one selected inside the
contentArea ). |
private boolean |
printDocument()
Opens a "Print" dialog to make the user select the printing settings, then prints
the document that is inside the selected
EventLogEditor editor (the one
inside the contentArea ). |
private void |
redoEventLog()
Redoes the last action undone inside the text area of the the
EventLogEditor
editor (the one selected inside the
contentArea ). |
private void |
resetZoomEventLog()
Reset to the default value the font size of the content of the
EventLogEditor
editor (the one selected inside the
contentArea ). |
private boolean |
saveAsEventLog(String selectedFileName)
Opens a "Save As" dialog to ask the user to decide where to save the content of
the
EventLogEditor editor (the one selected inside the
contentArea ),
then it tries to save the content in the selected file. |
private boolean |
saveEventLog()
Saves the content of the
EventLogEditor editor (the one selected inside
the contentArea )
in its own file, if an editor is selected. |
private void |
setFootprintFilters()
Shows a filters dialog associated with the
EventLogEditor editor
(the selected one inside the
contentArea ). |
private void |
setStandardListeners()
Adds to the standard components of the View the respective listeners
|
private void |
showAbout()
Shows the application credits (About).
|
private void |
showSettings()
Shows the application settings to manage all the available values
for the application, the
EventLogEditor and the XES Standard. |
void |
start()
Starts the application by calling the
start()
method of the View to show the GUI to the user |
private void |
undoEventLog()
Undoes the last action done inside the text area of the the
EventLogEditor
editor (the one selected inside the
contentArea ). |
private boolean |
validateEventLog()
Validates the content of the
EventLogEditor editor (the one selected
inside the contentArea ),
checking if its content respects the XES XSD Schema and therefore it is a valid XES document. |
private void |
zoomInEventLog()
Increases by 1pt the font size of the content of the
EventLogEditor editor
(the one selected inside the
contentArea ). |
private void |
zoomOutEventLog()
Decreases by 1pt the font size of the content of the
EventLogEditor
editor (the one selected inside the
contentArea ). |
private EventLogManagerView elmView
EventLogManagerView
element
that represents the View of the application.EventLogManagerView
private EventLogManagerModel elmModel
EventLogManagerModel
element
that represents the Model of the application.EventLogManagerModel
private EventLogManagerController.DefaultInternalFrameListener defaultInternalFrameListener
DefaultInternalFrameListener
,
will be the JInternalFrameListener
for all the JInternalFrame
frames created.JInternalFrame
private EventLogManagerController.FooterAreaButtonActionListener footerAreaButtonActionListener
FooterAreaButtonActionListener
,
will be the ActionListener
for all the
FooterAreaButton
buttons.ActionListener
private EventLogManagerController.PopupMenuItemActionListener popupMenuItemActionListener
PopupMenuItemActionListener
,
will be the ActionListener
for all the JMenuItem
items that are
inside the JPopupMenu
pop-up menus associated to the
FooterAreaButton
buttons.JMenuItem
,
JPopupMenu
,
ActionListener
private EventLogManagerController.EventLogEditorDocumentListener eventLogEditorDocumentListener
EventLogEditorDocumentListener
,
will be the DocumentListener
for all the
EventLogEditor
text areas.DocumentListener
private EventLogManagerController.FilterPanelActionListener filterPanelActionListener
FilterPanelActionListener
,
will be the ActionListener
for all the opened
FilterPanel
.private EventLogManagerController.GenerateEventLogActionListener generateEventLogActionListener
GenerateEventLogActionListener
,
will be the ActionListener
for all the dialogs that are created to
manage the generation of event log from expressions.private EventLogManagerController.SettingsActionListener settingsActionListener
SettingsActionListener
,
will be the ActionListener
for all the dialogs that are created to
show and manage the application settings.private EditorManager editorManager
EditorManager
used by the Controller to manage all the operations
associated with the MenuAreaButton
buttons in the application tab menu
that are connected to the management of logs, files and editors.private AnalysisManager analysisManager
AnalysisManager
used by the Controller to manage all the operations
associated with the MenuAreaButton
buttons in the application tab menu
that are connected to analysis procedures and management.private InfoManager infoManager
InfoManager
used by the Controller to manage all the operations
associated with the MenuAreaButton
buttons in the application tab menu
that are connected to the application in general (information about the system and
global settings).public EventLogManagerController(EventLogManagerView elmView, EventLogManagerModel elmModel)
EventLogMangerController
, with the View and
the Model to manage.
The constructor then initialises and adds to the View components the
respective listeners using the setStandardListeners()
method.
At the end, it initialise all the utility classes that it needs.
elmView
- the EventLogManagerView
object that represents the ViewelmModel
- the EventLogManagerModel
object that represents the ModelEventLogManagerView
,
EventLogManagerModel
public void start()
start()
method of the View to show the GUI to the userprivate void setStandardListeners()
public EventLogManagerView getView()
EventLogManagerView
elmView
element.elmView
component representing the View managed by this Controller.public EventLogManagerModel getModel()
EventLogManagerModel
elmModel
element.elmModel
component representing the Model managed by this Controller.public EditorManager getEditorManager()
EditorManager
editorManager
element.editorManager
representing the Editor Manager used by this Controller.public AnalysisManager getAnalysisManager()
AnalysisManager
analysisManager
element.analysisManager
representing the Analysis Manager used by this Controller.public InfoManager getInfoManager()
InfoManager
infoManager
element.infoManager
representing the Info Manager used by this Controller.public void newEventLogEditor(String editorTitle, Reader editorContent, String associatedFilePath, boolean isContentModified)
EventLogEditor
internal frame inside the
contentArea
,
then adds a new FooterAreaButton
button inside the
footerArea
,
both with the same title.
After that, set the listeners to these two components to implement their connection and functionalities.
At the end, set the content, the associated file and the modified status of the
EventLogEditor
, depending on the values of these parameters.
editorTitle
- the title of the editor, null
for an auto-generated default titleeditorContent
- the Reader
object opened over the editor content, null
for an empty editorassociatedFilePath
- the absolute path of the file associated with this editor,
null
when the editor does not have yet an associated fileisContentModified
- if the editor has to be set as modified or notEventLogEditor
,
FooterAreaButton
public void newFootprintMatrixInfo(String documentTitle, String documentContent, String associatedFilePath, boolean isContentExported)
FootprintMatrixInfo
internal frame inside the
contentArea
,
then adds a new FooterAreaButton
button inside the
footerArea
,
both with the same title.
After that, set the listeners to these two components to implement their connection and functionalities.
At the end, set the content, the associated file and the exported status of the
FootprintMatrixInfo
, depending on the values of these parameters.
documentTitle
- the title of the document, null
for an auto-generated default titledocumentContent
- the content of the document, null
for no contentassociatedFilePath
- the absolute path of the file associated with this footprint matrix,
null
when the matrix does not have yet an associated fileisContentExported
- if the footprint matrix has to be set as exported or notFootprintMatrixInfo
,
FooterAreaButton
public void newInternalFrame(String frameTitle, Component frameContent)
JInternalFrame
object inside the
contentArea
,
then adds a new FooterAreaButton
button inside the
footerArea
,
both with the same title.
After that, set the listeners to these two components to implement their connection and functionalities.
At the end, set the content of the JInternalFrame
, if not null
.
frameTitle
- the title of the internal frame, null
for an auto-generated default titleframeContent
- the Component
object to add inside the internal frame, null
for no contentJInternalFrame
,
FooterAreaButton
public void modifyJInternalFrameTitles(JInternalFrame targetInternalFrame, String newTitle)
newTitle
passed as parameter
and then updates all its references in the associated FooterAreaButton
to keep
the integrity and the association between them.targetInternalFrame
- the target internal frame to setnewTitle
- the new title of the target internal frame and its associated components on the applicationFooterAreaButton
,
JInternalFrame
public JInternalFrame findJInternalFrame(String targetID)
JInternalFrame
inside the
contentArea
using its title, returning it or null
otherwise.targetID
- the identifier of the target internal frame to findJInternalFrame
if the method finds it, null
otherwiseJInternalFrame
public FooterAreaButton findFooterAreaButton(JInternalFrame target)
FooterAreaButton
button of the target
JInternalFrame
, returning it or null
otherwise.target
- the JInternalFrame
associated with the button to findFooterAreaButton
button associated to the target JInternalFrame
, null
otherwise.JInternalFrame
public boolean checkInternetConnection(String url, int timeout)
The method is helpful to check if there is Internet connection in general,
to check if a specific resource, specified by its URL, can be accessed through
it using an HTTP connection and to check if and HEAD request to this URL returns
a response code between 200 and 399. If all of these cases are confirmed, the
method will return true
.
Either if there is not Internet connection, or if the resource is unreachable,
or if the response code given by the resource is not success/redirect, the method
will return false
instead.
The possible response code are the following:
url
- the URL to checktimeout
- the timeout for the responsetrue
if the method reached the URL in the given time and the response code is between 200 and 399, false
otherwiseprivate void newEventLog()
This method just calls the EditorManager
newEventLog(ActionListener)
method.
EventLogEditor
,
EditorManager
private void generateEventLog(String exp)
EventLogEditor
with the CSV representation of the generated traces, or the
complete log in XES standard.
This method just calls the AnalysisManager
generateEventLog(String)
method.exp
- the String
representing the expression that defines the possible event tracesprivate void openEventLog(String selectedFileName)
This method just calls the EditorManager
openEventLog(String, boolean...)
method.
selectedFileName
- the file name to set as selected in the dialog, null
for no selectionEventLogEditor
,
EditorManager
private boolean closeInternalFrame(JInternalFrame internalFrame)
JInternalFrame
passed as parameter, if one is passed,
or the selected one inside the
contentArea
,
if a frame is set as selected.
This method just calls the EditorManager
closeInternalFrame(JInternalFrame)
method.
internalFrame
- the internal frame to close, null
to close the selected internal frame inside the
contentArea
true
if the closing operation successfully close the internal frame, false
otherwiseJInternalFrame
,
EventLogEditor
,
EditorManager
private boolean saveEventLog()
EventLogEditor
editor (the one selected inside
the contentArea
)
in its own file, if an editor is selected.
This method just calls the EditorManager
saveEventLog()
method.
EventLogEditor
,
EditorManager
private boolean saveAsEventLog(String selectedFileName)
EventLogEditor
editor (the one selected inside the
contentArea
),
then it tries to save the content in the selected file.
This method just calls the EditorManager
saveAsEventLog(String)
method.
selectedFileName
- the file name to set as selected in the dialog, null
for using the EventLogEditor
titleEventLogEditor
,
EditorManager
private boolean printDocument()
EventLogEditor
editor (the one
inside the contentArea
).
This method just calls the EditorManager
printDocument()
method.
EventLogEditor
,
EditorManager
private boolean importDocument(String selectedFileName)
This method just calls the EditorManager
importDocument(String)
method.
selectedFileName
- the file name to set as selected in the dialog, null
for no selectiontrue
if we successfully import the file, false
otherwiseEditorManager
private boolean exportDocument(String selectedFileName)
EventLogEditor
editor or of the selected
FootPrintMatrixInfo
document (that are both inside the
contentArea
).
The method then tries to export the content of the selected frame in the selected file
(CSV format available for the EventLogEditor
; HTML, LaTeX, PDF and PNG formats
available for the FootPrintMatrixInfo
).
This method just calls the EditorManager
exportDocument(String)
method.
selectedFileName
- the file name to set as selected in the dialog, null
for no selectiontrue
if we successfully export the file, false
otherwiseEditorManager
,
FootprintMatrixInfo
private void cutEventLog()
EventLogEditor
editor
(the one selected inside the
contentArea
)
into the system clipboard.
This method just calls the EditorManager
cutEventLog()
method.
private void copyEventLog()
EventLogEditor
editor
(the one selected inside the
contentArea
)
into the system clipboard.
This method just calls the EditorManager
copyEventLog()
method.
private void pasteEventLog()
EventLogEditor
editor (the one selected inside the
contentArea
).
This method just calls the EditorManager
pasteEventLog()
method.
private void undoEventLog()
EventLogEditor
editor (the one selected inside the
contentArea
).
This method just calls the EditorManager
undoEventLog()
method.
private void redoEventLog()
EventLogEditor
editor (the one selected inside the
contentArea
).
This method just calls the EditorManager
redoEventLog()
method.
private void zoomInEventLog()
EventLogEditor
editor
(the one selected inside the
contentArea
).
This method just calls the EditorManager
zoomInEventLog()
method.
EventLogEditor
private void zoomOutEventLog()
EventLogEditor
editor (the one selected inside the
contentArea
).
This method just calls the EditorManager
zoomOutEventLog()
method.
EventLogEditor
private void resetZoomEventLog()
EventLogEditor
editor (the one selected inside the
contentArea
).
This method just calls the EditorManager
resetZoomEventLog()
method.
EventLogEditor
private boolean validateEventLog()
EventLogEditor
editor (the one selected
inside the contentArea
),
checking if its content respects the XES XSD Schema and therefore it is a valid XES document.
This method just calls the AnalysisManager
validateEventLog()
method.
EventLogEditor
,
AnalysisManager
private void generateEventLogFootprint(boolean showMatrix, EventLogEditor editor, FootprintFilter... filter)
EventLogEditor
(or the passed one as parameter),
using the EventLogEditor
filter (or the one passed as parameter), creating at the end of the process a HTML report
with a footprint matrix in it representing the casual dependencies between event traces.
The report will be eventually showed to the user using a FootprintMatrixInfo
, if asked by using the relative parameter.
If the editor filter is not complete while analysing the document, the process, instead of using that filter (because not complete), records all the needed information and updates the filter to make it complete for the next analysis.
This method just calls the AnalysisManager
generateEventLogFootprint(boolean, EventLogEditor, FootprintFilter...)
method.
showMatrix
- true
to open a FootprintMatrixInfo
with the result of the analysis, false
to make the analysis and save the result, but without showing them to the usereditor
- the EventLogEditor
containing the XES log to analyse, null
to use the selected editor inside the applicationfilter
- the FootprintFilter
to use for the analysis, nothing (this is a optional parameter) to use the editor filter.EventLogEditor
,
AnalysisManager
,
FootprintFilter
,
FootprintMatrixInfo
private void setFootprintFilters()
EventLogEditor
editor
(the selected one inside the
contentArea
).
The dialog content will be calculated based on the editor
FootprintFilter
, to show to the user the possible selections.
A EventLogManagerController.FilterPanelActionListener
will be associated to the dialog buttons
to implement the panel functions.
This method just calls the AnalysisManager
setFootprintFilters(ActionListener)
method.
private void generateXesFromCsv()
EventLogEditor
(the one inside the contentArea
).
The method will open a new EventLogEditor
editor with the generated log inside of it.
This method just calls the AnalysisManager
generateXesFromCsv()
method.private void showSettings()
EventLogEditor
and the XES Standard.
This method just calls the InfoManager
showSettings(ActionListener)
method.private void showAbout()
InfoManager
showAbout()
method.